package com.twxm.breed.service;

import com.twxm.breed.entity.FishPond;
import com.twxm.breed.mapper.FishPondMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class FishPondService {
    @Autowired
    private FishPondMapper fishPondMapper;

    @Transactional(rollbackFor = Exception.class)
    public void insertPond(FishPond fishPond) throws Exception{fishPondMapper.insertPond(fishPond);}


    public FishPond selectById(String pondId){return fishPondMapper.selectById(pondId);}

    public List<String> getId() {
        return fishPondMapper.getId();
    }

    public List<FishPond> getAll() {
        return fishPondMapper.selectAll();
    }

    public void deleteById(String pondId) {
        fishPondMapper.deleteFishpondById(pondId);
    }
}
